{{--/**
 * Created by PhpStrom
 * User: 郭碧云
 * Date: 2021/7/21 16:01
 * Desc:
 */--}}
<style>
    .layui-line-height{
        line-height: 36px;
    }
</style>
<div style="margin-top: 15px;">
    <div class="layui-form-item">
        <label class="layui-form-label">题型:</label>
        <div class="layui-input-block">
            <div id="type" class="layui-line-height">{{$info["type"]["name"]}}</div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">组织机构:</label>
        <div class="layui-input-block">
            <div id="org" class="layui-line-height">{{$info["org"]["name"]}}</div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">科目:</label>
        <div class="layui-input-block">
            <div id="category" class="layui-line-height">{{$info["category"]["name"]}}</div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">选择版本:</label>
        <div class="layui-input-block">
            <div id="version" class="layui-line-height">{{$info["version"]["version"]}}</div>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">标签:</label>
        <div class="layui-input-block">
            <div id="tag_id" class="layui-line-height">{{empty($info["tag"])?"":$info["tag"]["name"]}}</div>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">题干</label>
        <div class="layui-input-block" style="padding-top: 11px">
            {!!$info["question"]!!}
        </div>
    </div>

    {{--客观题选项--}}
    @if($info["type"]["choice_type"]<=3&&$info["type"]["choice_type"]>0)
        <div>
            @foreach($info["content"]["answer"] as $k=>$item)
                <div class="layui-form-item">
                    <label class="layui-form-label">备选项</label>
                    <div class="layui-input-block" style="padding-top: 9px">
                        <div style="float: left">{{strtoupper(chr($k+1+64))}}.</div>
                        <div style="float: left">{!!$item["option"]!!}</div>
                    </div>
                </div>
            @endforeach
        </div>
    @endif

    {{--答案--}}
    <div>
        <label class="layui-form-label">答案</label>
        <div class="layui-input-block" style="padding-top: 9px">
            @if($info["type"]["choice_type"]<=3&&$info["type"]["choice_type"]>0){{--单/多选--}}
            @foreach($info["content"]["answer"] as $k=>$v)
                @if(array_key_exists("flag",$v))
                    {{strtoupper(chr($k+1+64))}},
                @endif
            @endforeach
            @elseif($info["type"]["choice_type"]==4){{--判断--}}
            {{$info["content"]["answer"]["objective"]==1?'对':'错'}}
            @elseif($info["type"]["choice_type"]==5){{--定值填空--}}
            {{str_replace("==",",",$info["content"]["answer"][0])}}
            @elseif($info["type"]["choice_type"]==6){{--变量题--}}
            @foreach($info["content"]["answer"]["x"] as $x)
                <p style="margin-top: 5px;">变量组{{$loop->index+1}}：{{implode(",",$x)}}</p>
            @endforeach
        <div style="width: 80%;height: 1px;background-color: #cccccc;margin-top: 3px;margin-bottom: 3px;"></div>
            @foreach($info["content"]["answer"]["y"] as $y)
                <p style="margin-top: 5px;">答案组{{$loop->index+1}}：{{$y["key"]}}={{$y["result"]}}</p>
            @endforeach
            @else
                {!! $info["content"]["answer"][0]!!}
            @endif
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">难度</label>
        <div class="layui-input-block layui-line-height" style="width: 46.7%;">
            {{\App\Facades\Code::name("QUESTION_LEVEL",$info["level"])}}
        </div>
    </div>
    {{--答案解析--}}
    <div class="layui-form-item">
        <label class="layui-form-label">解析</label>
        <div class="layui-input-block" class="layui-line-height" style="padding-top: 9px">
            {!!$info["content"]["explanation"]!!}
        </div>
    </div>
</div>
